package xjtu.sad.zbsj.user.pesonal.impl;

import xjtu.sad.zbsj.user.pesonal.Personal;
import xjtu.sad.zbsj.user.pesonal.PersonalDto;
import xjtu.sad.zbsj.user.pesonal.PersonalService;
import xjtu.sad.zbsj.user.pesonal.dao.PersonalDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @author lkm
 */
@Slf4j
@Service
@Transactional
public class PersonalServiceImpl implements PersonalService {
    @Resource
    private PersonalDao personalDao;

    @Override
    public Personal getPersonalByU_id(String userId) {
        Personal currentUser = personalDao.findPersonalInfo(userId);
        return currentUser;
    }

    @Override
    public void updatePersonalInfo(PersonalDto personalDto) {
        personalDao.updatePersonalInfo(personalDto);
    }
}
